<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java"  pageEncoding="UTF-8" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>主人信息修改页面</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="${pageContext.request.contextPath}/static/css/css.css" rel="stylesheet" type="text/css">

    <style type="text/css">
        #content {
            position: relative;
            top: 3px;
            width: 80%;
            height: 380px;
            margin: auto;
            overflow: hidden;
            z-index: 2;
        }

        .tab1 {
            position: relative;
            top: 60px;
            font-size: 24px;
        }

        #in1, #in2, #in3, #in4 ,#in6{
            width: 250px;
            height: 30px;
            font-size: 24px;
        }


    </style>
    <script type="text/javascript">
        function checkId() {
            if (document.getElementById("in1").value == ""
                && document.getElementById("in3").value == ""
                && document.getElementById("in2").value == ""
                && document.getElementById("in6").value == "") {
                alert("请修改完主人相关信息！");
                return false;
            } else if (document.getElementById("in1").value == "") {
                alert("请输入主人名称！");
                return false;
            } else if (document.getElementById("in3").value == "") {
                alert("请输入地址！");
                return false;
            } else if (document.getElementById("in2").value == "") {
                alert("请输入城市！");
                return false;
            } else if (document.getElementById("in6").value == "") {
                alert("请输入电话号！");
                return false;
            }else {
                return true;
            }
        }
    </script>
</head>
<body>
<!-- include top -->
<jsp:include page="${pageContext.request.contextPath}/top.jsp" flush="true"/>
<center>
    <div id="content">
        <c:if test="${msg!=null}">
            <span style="color: red">${msg}</span>
        </c:if>
        <form action="${pageContext.request.contextPath}/own/ownUpdate" method="post" onsubmit="return checkId()">
            <table border="0" cellpadding="0" cellspacing="2" class="tab1">
                <tr align="center">
                    <td>主人名称&nbsp;</td>
                    <td><input type="text" name="name" id="in1" value="${owners.name}">
                    </td>
                </tr>
                <tr align="center">
                    <td>地址&nbsp;</td>
                    <td><input type="text" name="address" id="in3" value="${owners.address}" />
                    </td>
                </tr>
                <tr align="center">
                    <td>城市&nbsp;</td>
                    <td><input type="text" name="city" id="in2" value="${owners.city}" />
                    </td>
                </tr>
                <tr align="center">
                    <td>电话号码&nbsp;</td>
                    <td><input type="text" name="telephone" id="in6" value="${owners.telephone}" />
                    </td>
                </tr>
                <tr align="center">
                    <td colspan="2">
                        <input type="hidden" name="id" value="${owners.id}" />
                        <input class="btn btn-default" type="submit" value="修改">
                        <a class="btn btn-default" href="${pageContext.request.contextPath}/own/abandonUpdate"
                           role="button">放弃</a>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</center>
<!-- include footer -->
<jsp:include page="${pageContext.request.contextPath}/footer.jsp" flush="true"/>
</body>
</html>
